package no.rodland.acc.utils;

import org.constretto.ConstrettoBuilder;
import org.constretto.ConstrettoConfiguration;
import org.springframework.core.io.DefaultResourceLoader;

/**
 * Created by IntelliJ IDEA.
 *
 * @Since: Jun 22, 2010 9:37:56 PM
 * @Author: fmr
 */
public class Config {
    private static ConstrettoConfiguration config;

    static {
        config = new ConstrettoBuilder()
                .createPropertiesStore()
                .addResource(new DefaultResourceLoader().getResource("classpath:acc.properties"))
                .done()
                .getConfiguration();
    }

    public static String getProperty(String key) {
        return getPropertyAsString(key);
    }

    public static String getPropertyAsString(String key) {
        return config.evaluateToString(key);
    }

    public static <T> T on(T object) {
        return config.on(object);
    }
}
